
WHILE 1 DO BEGIN


restore,'./irdc_dist_model/morph_fmatch.sav',/ver
restore,'./irdc_dist_model/data/case3_irdc_grid_AT.sav',/ver

n_A = 21
A = findgen(n_A)*0.025

n_Td = 21
Td = findgen(n_Td)*1. + 10.

myps,'./irdc_dist_model/analysis_plots/morph_A_Td.eps',/cmyk,xsize=10,ysize=9

multiplot_xm,[2,2],mxtitle='Foreground "veil" (A)',$;/doyaxis,/doxaxis,$
             mytitle='Dust Temperature [K]',/xmargin;,ygap=0.04


loadct,13,/silent

print,m4_Stat(mmatch)
plotimage,mmatch,range=[0,1],xst=4,yst=4,title='Morph vs. Model'
axis,xaxis=0,xr=[-0.0125,.5125],/xst,/save
axis,xaxis=1,xr=[-0.0125,.5125],/xst,/save,xtickformat='blank_axis'
axis,yaxis=0,yr=[9.5,30.5],/yst,/save,ytickformat="(I0)"
axis,yaxis=1,yr=[9.5,30.5],/yst,/save,ytickformat='blank_axis'

levels = min(grid) + [2.3, 6.2, 11.8, 20, 30, 40, 50, 100]
colors = [replicate('WT3',3),replicate('RED6',4),'WT3']
print,levels
gTd = dindgen(81)*0.25d + 10.d
gA = dindgen(51)*0.01d
cgContour,grid,gA,gTd,levels=levels,/overplot,c_colors=colors,$
          c_thick=5,c_labels=0

multiplot,/doyaxis;,/doxaxis

print,m4_Stat(gmatch)
plotimage,gmatch,range=[0,1],xst=4,yst=4,title='Morph vs. GRS'
axis,xaxis=0,xr=[-0.0125,.5125],/xst,/save
axis,xaxis=1,xr=[-0.0125,.5125],/xst,/save,xtickformat='blank_axis'
axis,yaxis=0,yr=[9.5,30.5],/yst,/save,ytickformat='blank_axis'
axis,yaxis=1,yr=[9.5,30.5],/yst,/save,ytickformat='blank_axis'

levels = min(grid) + [2.3, 6.2, 11.8, 20, 30, 40, 50, 100]
colors = [replicate('WT3',3),replicate('RED6',4),'WT3']
print,levels
gTd = dindgen(81)*0.25d + 10.d
gA = dindgen(51)*0.01d
cgContour,grid,gA,gTd,levels=levels,/overplot,c_colors=colors,$
          c_thick=5,c_labels=0

loadct,13,/silent
cgColorbar,range=[0.,100.],/vertical,/right,position=[0.93,0.12,0.95,0.91],$
           title='Percent Matching',charsize=0.8

multiplot;,/doxaxis,/doyaxis
;;============================================
;; High Contrast Plots

loadct,13,/silent

print,m4_Stat(hcmmatch)
plotimage,mmatch,range=[0,1],xst=4,yst=4,title='Morph vs. Model'
axis,xaxis=0,xr=[-0.0125,.5125],/xst,/save
axis,xaxis=1,xr=[-0.0125,.5125],/xst,/save,xtickformat='blank_axis'
axis,yaxis=0,yr=[9.5,30.5],/yst,/save,ytickformat="(I0)"
axis,yaxis=1,yr=[9.5,30.5],/yst,/save,ytickformat='blank_axis'

levels = min(grid) + [2.3, 6.2, 11.8, 20, 30, 40, 50, 100]
colors = [replicate('WT3',3),replicate('RED6',4),'WT3']
print,levels
gTd = dindgen(81)*0.25d + 10.d
gA = dindgen(51)*0.01d
cgContour,grid,gA,gTd,levels=levels,/overplot,c_colors=colors,$
          c_thick=5,c_labels=0

multiplot;,/doyaxis,/doxaxis

print,m4_Stat(hcgmatch)
plotimage,gmatch,range=[0,1],xst=4,yst=4,title='Morph vs. GRS'
axis,xaxis=0,xr=[-0.0125,.5125],/xst,/save
axis,xaxis=1,xr=[-0.0125,.5125],/xst,/save,xtickformat='blank_axis'
axis,yaxis=0,yr=[9.5,30.5],/yst,/save,ytickformat='blank_axis'
axis,yaxis=1,yr=[9.5,30.5],/yst,/save,ytickformat='blank_axis'

levels = min(grid) + [2.3, 6.2, 11.8, 20, 30, 40, 50, 100]
colors = [replicate('WT3',3),replicate('RED6',4),'WT3']
print,levels
gTd = dindgen(81)*0.25d + 10.d
gA = dindgen(51)*0.01d
cgContour,grid,gA,gTd,levels=levels,/overplot,c_colors=colors,$
          c_thick=5,c_labels=0


;; Labels for the Contrast Contents
cgText,/norm,alignment=0.5,charsize=1.5,$
       0.5,0.93,'All Sources',color='White'
cgText,/norm,alignment=0.5,charsize=1.5,$
       0.5,0.48,'C '+cgSymbol('geq')+' 0.1',color='White'



myps,/done,/mp



print,''
message,'Last Update at '+systime(0),/inf
message,'Now waiting 5 minutes, then repeat...',/inf
wait,300

ENDWHILE

END
